package com.young.springdemo.service.visitorpattern;

import java.util.ArrayList;
import java.util.List;

//员工信息表,充当对象结构
public class EmployeeList {


    private List<Employee> employeeList = new ArrayList<>();

    public void add(Employee employee){
        employeeList.add(employee);
    }
    public void remove(Employee employee){
        employeeList.remove(employee);
    }
    public void accept(Department department){
        for (Employee employee : employeeList){
            employee.accept(department);
        }
    }

}
